<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>
<table border="1">
  <caption>用户信息</caption>
  <tr>
    <th>姓名</th>
    <th>密码</th>
    <th>昵称</th>
  </tr>
</table>

<script>
  let arr = [{username:"张三",password:123,nickname:"老三"},
    {username:"李四",password:123,nickname:"老四"},
    {username:"王老五",password:123,nickname:"老五"}]
  let table = document.querySelector("table");
  for (let product of arr) {
    let tr = document.createElement("tr");
    let nameTd = document.createElement("td");
    let pwTd = document.createElement("td");
    let nnTd = document.createElement("td");
    nameTd.innerText = product.username;
    pwTd .innerText = product.password;
    nnTd.innerText = product.nickname;
    tr.append(nameTd,pwTd,nnTd);
    table.append(tr);
  }
</script>
</body>
</html>